package per.jdz.demo.utils;

import java.time.LocalDate;

public class DateUtil {

    public static String getYesterday() {
        return LocalDate.now().minusDays(1).toString();
    }

    public static LocalDate getToday() {
        return LocalDate.now();
    }

    public static void main(String[] args) {
        // 获取当前日期
        LocalDate today = LocalDate.now();
        // 获取昨天的日期
        LocalDate yesterday = today.minusDays(1);

        System.out.println("昨天的日期是: " + yesterday);
    }
}
